public class HF_ClientWSAccountphone{
@future (callout=true)
      public static void AddAccountPhone(set<Id> phset) {
      string outputresult;
      List<Account_Phone__c> phList = new List<Account_Phone__c>([select Id,Account_PIMS_Id__c,Phone__c,Extension__c,Phone_Type_Code__c,Preferred_Flag__c,Country_Name__c,StatusCode__c,Description__c from Account_Phone__c where ID In: phset]); 
      WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
      for(Account_Phone__c ph: phList){
        
      //Stores Phone details in PhonesWrapper
                WebServiceFinal2.PhoneWrapper p=new WebServiceFinal2.PhoneWrapper();
                p.SfdcPhoneID = ph.Id;
                p.PartnerContactID=ph.Account_PIMS_Id__c;
                p.NameID =0;    
                p.Phone=ph.Phone__c;
                p.Extn=String.Valueof(ph.Extension__c);
                p.PhoneType=ph.Phone_Type_Code__c;
                p.PreferredPhone=ph.Preferred_Flag__c;
                p.Comments=ph.Description__c;
                p.Country=ph.Country_Name__c;
                p.Status=ph.StatusCode__c;
                p.DataOn=system.DateTime.Now();
        try
        {
            outputresult=s.AddAccountPhone(p);
            system.debug('****'+outputresult);
        }
        catch(Exception ex)
          {
            system.debug('output from webservice: '+ex);       
          }
        }       
} 
    
    @future (callout=true)
          public static void UpdateAccountPhone(set<Id> phset) {
          string outputresult;
          List<Account_Phone__c> phList = new List<Account_Phone__c>([select Id,Account_PIMS_Id__c,Phone__c,Extension__c,Phone_Type_Code__c,Preferred_Flag__c,Country_Name__c,StatusCode__c,Description__c from Account_Phone__c where ID In: phset]); 
          WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
          for(Account_Phone__c ph: phList){
             
         //Stores Phone details in PhonesWrapper
                WebServiceFinal2.PhoneWrapper p=new WebServiceFinal2.PhoneWrapper();
                p.SfdcPhoneID = ph.Id;
                p.PartnerContactID=ph.Account_PIMS_Id__c;
                p.NameID = 0;
                p.Phone=ph.Phone__c;
                p.Extn=String.Valueof(ph.Extension__c);
                p.PhoneType=ph.Phone_Type_Code__c;
                p.PreferredPhone=ph.Preferred_Flag__c;
                p.Comments=ph.Description__c;
                p.Country=ph.Country_Name__c;  
                p.Status=ph.StatusCode__c;
                p.DataOn=system.DateTime.Now();
        try
        {
                outputresult=s.UpdateAccountPhone(p);
                system.debug('****'+outputresult);
        }
        catch(Exception ex)
          {
                system.debug('output from webservice: '+ex);       
          }
        }       
      } 
}